package com.example.administrator.daggerdemo.utils;

import android.content.Context;
import android.content.SharedPreferences;


import com.example.administrator.daggerdemo.MyApplication;

/**
 * Created by lixiang on 16-5-27.
 */
public class XmlUtils {
    private static SharedPreferences sharedPreferences;

    public static SharedPreferences getSharedPreferences(){
        if(sharedPreferences == null)
        {
           sharedPreferences = MyApplication.getInstance().getSharedPreferences("xqx", Context.MODE_PRIVATE);
        }
        return sharedPreferences;

    }

    public static void put(String name ,String value){
        getSharedPreferences().edit().putString(name,value).commit();
    }


    public static String get(String name,String defaultValue)
    {
        return getSharedPreferences().getString(name,defaultValue);
    }




}
